package com.apollographql.apollo.internal.interceptor;

//import HOS.core.app.NotificationCompat;
import com.apollographql.apollo.exception.ApolloNetworkException;
import com.apollographql.apollo.interceptor.ApolloInterceptor;
import java.io.IOException;
import com.kt.Metadata;
import com.kt.jvm.internal.Intrinsics;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.Response;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000%\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0018\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u0007H\u0016J\u0018\u0010\b\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0006\u0010\t\u001a\u00020\nH\u0016¨\u0006\u000b"}, d2 = {"com/apollographql/apollo/internal/interceptor/ApolloServerInterceptor$executeHttpCall$1", "Lokhttp3/Callback;", "onFailure", "", "NotificationCompat.CATEGORY_CALL", "Lokhttp3/Call;", "e", "Ljava/io/IOException;", "onResponse", "response", "Lokhttp3/Response;", "apollo-runtime"}, k = 1, mv = {1, 4, 0})
/* compiled from: ApolloServerInterceptor.kt */
public final class ApolloServerInterceptor$executeHttpCall$1 implements Callback {
    final /* synthetic */ ApolloInterceptor.CallBack $callBack;
    final /* synthetic */ Call $httpCall;
    final /* synthetic */ ApolloInterceptor.InterceptorRequest $request;
    final /* synthetic */ ApolloServerInterceptor this$0;

    ApolloServerInterceptor$executeHttpCall$1(ApolloServerInterceptor this$02, Call $captured_local_variable$1, ApolloInterceptor.InterceptorRequest $captured_local_variable$2, ApolloInterceptor.CallBack $captured_local_variable$3) {
        this.this$0 = this$02;
        this.$httpCall = $captured_local_variable$1;
        this.$request = $captured_local_variable$2;
        this.$callBack = $captured_local_variable$3;
    }

    @Override // okhttp3.Callback
    public void onFailure(Call call, IOException e) {
        Intrinsics.checkParameterIsNotNull(call, "call");
        Intrinsics.checkParameterIsNotNull(e, "e");
        if (!this.this$0.getDisposed() && this.this$0.getHttpCallRef().compareAndSet(this.$httpCall, null)) {
            this.this$0.getLogger().e(e, "Failed to execute http call for operation %s", this.$request.operation.name().name());
            this.$callBack.onFailure(new ApolloNetworkException("Failed to execute http call", e));
        }
    }

    @Override // okhttp3.Callback
    public void onResponse(Call call, Response response) {
        Intrinsics.checkParameterIsNotNull(call, "call");
        Intrinsics.checkParameterIsNotNull(response, "response");
        if (!this.this$0.getDisposed() && this.this$0.getHttpCallRef().compareAndSet(this.$httpCall, null)) {
            this.$callBack.onResponse(new ApolloInterceptor.InterceptorResponse(response));
            this.$callBack.onCompleted();
        }
    }
}
